package com.gp.service;

import com.gp.model.entity.BaseAddress;
import com.gp.model.entity.BaseUser;

import java.util.List;

import com.baomidou.mybatisplus.service.IService;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 弓成龙
 * @since 2017-12-19
 */
public interface IBaseAddressService extends IService<BaseAddress> {

	/**
	 * 根据用户id获取收货地址
	 * 
	 * @param userId
	 * @return
	 */
	List<BaseAddress> getAddressList(Long userId);

	/**
	 * 获取用户的默认地址
	 * 
	 * @param addressId
	 * @return
	 */
	BaseAddress getAddress(Long addressId);

	/**
	 * 主键自增脏
	 * 
	 * @param address
	 * @return
	 */
	int insertAddress(BaseAddress address);

	/**
	 * 重置默认地址
	 * 
	 * @param baseUser
	 */
	void resetAddress(BaseUser baseUser);

}
